﻿using Microsoft.EntityFrameworkCore.Migrations;

namespace Core.DataAccess.Model.Migrations.Project
{
    public partial class addprojectuserinfoparaneter : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AlterColumn<int>(
                name: "ProjectId",
                table: "Project_User_Api_Order",
                nullable: true,
                oldClrType: typeof(int));

            migrationBuilder.AlterColumn<int>(
                name: "ProjectId",
                table: "Project_User_Api",
                nullable: true,
                oldClrType: typeof(int));

            migrationBuilder.AlterColumn<string>(
                name: "token",
                table: "Project_User",
                unicode: false,
                maxLength: 32,
                nullable: true,
                defaultValueSql: "(right(newid(),(21)))",
                oldClrType: typeof(string),
                oldUnicode: false,
                oldMaxLength: 21,
                oldNullable: true,
                oldDefaultValueSql: "(right(newid(),(21)))");

            migrationBuilder.AddColumn<string>(
                name: "Parameter",
                table: "Project_User",
                nullable: true);

            migrationBuilder.AlterColumn<string>(
                name: "token",
                table: "Project_List",
                unicode: false,
                maxLength: 32,
                nullable: true,
                defaultValueSql: "(right(newid(),(21)))",
                oldClrType: typeof(string),
                oldUnicode: false,
                oldMaxLength: 21,
                oldNullable: true,
                oldDefaultValueSql: "(right(newid(),(21)))");
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "Parameter",
                table: "Project_User");

            migrationBuilder.AlterColumn<int>(
                name: "ProjectId",
                table: "Project_User_Api_Order",
                nullable: false,
                oldClrType: typeof(int),
                oldNullable: true);

            migrationBuilder.AlterColumn<int>(
                name: "ProjectId",
                table: "Project_User_Api",
                nullable: false,
                oldClrType: typeof(int),
                oldNullable: true);

            migrationBuilder.AlterColumn<string>(
                name: "token",
                table: "Project_User",
                unicode: false,
                maxLength: 21,
                nullable: true,
                defaultValueSql: "(right(newid(),(21)))",
                oldClrType: typeof(string),
                oldUnicode: false,
                oldMaxLength: 32,
                oldNullable: true,
                oldDefaultValueSql: "(right(newid(),(21)))");

            migrationBuilder.AlterColumn<string>(
                name: "token",
                table: "Project_List",
                unicode: false,
                maxLength: 21,
                nullable: true,
                defaultValueSql: "(right(newid(),(21)))",
                oldClrType: typeof(string),
                oldUnicode: false,
                oldMaxLength: 32,
                oldNullable: true,
                oldDefaultValueSql: "(right(newid(),(21)))");
        }
    }
}
